﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static _01_Tower3._0.ToolMenu;

namespace _01_Tower3._0
{
    internal class SceneBag : IScene
    {
        public string Name => "SceneBag";

        ToolMenu toolMenu;
        Map map;
        //Map map2;
        CombatSystem cs;
        
        public SceneBag(ToolMenu toolMenu,Map map,CombatSystem cs)
        {
            this.map = map;
            this.toolMenu = toolMenu;
            this.cs = cs;
            //this.map2 = map2;
            //toolMenu = new ToolMenu(84, 12, 12, 15, 10);
        }

        public void Init()
        {
          toolMenu.Init();
        }

        public void Input()
        {
            if (InputSystem.Instance.IsKeyPressed(ConsoleKey.O))
            {
                isOpen = false;
                SceneManger.instance.ChangeSceneByName(SceneManger.sceneName);
            }
            if (InputSystem.Instance.IsKeyPressed(ConsoleKey.Escape))
            {
                SceneManger.instance.ChangeSceneByName("SceneMenu");
            }
            toolMenu.Input();
        }

        public void Update()
        {
            toolMenu.Update();
            toolMenu.PrintInfo();
        }

        public void FixUpdate()
        {

        }

        public void Render()
        {
            InfoSystem.Instance.PrintInfo();
            if (SceneManger.sceneName == "SceneMap1")
            {
                map.Render();
            }
            if (SceneManger.sceneName == "SceneCombat")
            {
                cs.Render();
                cs.map.Render();
            }
        }
        public void End()
        {
            
        }
    }
}
